home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
Documents
/
NeXTAnswers
/
shell.616
< prev
next >
Wrap
Text File
|
1992-02-06
|
2KB
|
75 lines
{\rtf0\ansi{\fonttbl\f2\fnil Times-Roman;\f0\fmodern Courier;\f1\fswiss Helvetica;}
\paperw12720
\paperh6420
\margl120
\margr2700
{\colortbl\red0\green0\blue0;}
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\b0\i0\ul0\fs28 directory prompt csh\
\
Q: How do I make my C-Shell prompt display the current directory?\
\
A: Use a collection of aliases. The key is to alias each command which will change your working directory. One example:\
\
\pard\tx960\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs24\li720\fc0 set myhost=`hostname`\
\
# To include just the last component of the current directory\
# in the prompt, uncomment the second of these and comment\
# out the first.\
\
alias SetPrompt 'set prompt="$\{myhost\} [$cwd]-\\\\!% "'\
#alias SetPrompt 'set prompt="$\{myhost\} [$cwd:t]-\\\\!% "'\
\
alias cd 'cd \\!* && SetPrompt'\
alias cdl 'cd \\!*; ls'\
alias popd 'popd \\!* && SetPrompt'\
alias pushd 'pushd \\!* && SetPrompt'\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f2\fs28\fc0 \
You can include the
\b alias
\b0 commands in your
\b ~/.login
\b0 , in your
\b ~/.cshrc
\b0 , or, for example, in a file called
\b ~/.aliases
\b0 which is invoked in
\b .login
\b0 or
\b .cshrc
\b0 . The
\b .login
\b0 \
file is invoked each time you log in. The
\b .cshrc
\b0 file is invoked everytime you\
start up a new c-shell process. To invoke
\b ~/.aliases
\b0 from either of these files\
use:\
\f0\fs24 source ~/.aliases
\f2\fs28 \
\
Note also the alias
\b cdl
\b0 . This does a
\b cd
\b0 and then an
\b ls
\b0 . The
\i aliased
\i0 version of
\b cd
\b0 will be used by
\b cdl
\b0 .\
\
QA616\
\
Valid for 1.0 \
Valid for 2.0\
\